//
//  SEGNewDoorManager.h
//  YYKitDemo
//
//  Created by 刘山 on 2017/11/8.
//  Copyright © 2017年 Sam. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "SEGNewMyDoorListModel.h"
#import "SEGOpenDoorBaseAPI.h"

// 一键开门
//提交蓝牙门禁开门次数
#define kOpenDoorHis [SEGServerManager serverUrlJoint:kClientRootURL,@"/door-restapi/v1/userapp/openhis/submit",nil]
//网络门开门失败一键报单接口
#define kSubmitWorkOrder [SEGServerManager serverUrlJoint:kClientRootURL,@"/door-restapi/v1/userapp/workorder/submit",nil]
//门禁列表接口
#define kMyDoorList [SEGServerManager serverUrlJoint:kClientRootURL,@"/door-restapi/v1/userapp/doorList",nil]

@interface SEGNewDoorManager : NSObject
@property (nonatomic, strong)NSArray<SEGNewMyDoorListModel*>* dataMyDoorListSource;//所有门
@property (nonatomic, strong)NSArray<SEGNewMyDoorListModel*>* dataMyCommonDoorListSource;// 常用门

/**
 * 拉取所有门列表
 * @author Sam
 */
-(void)requestmyDoorListFinished:(SEGRequestCallBack)finished;

/**
 * 提交开门记录
 * @author Sam
 */
- (void)submitOpenDoorHistory;

/**
 * 开门失败一键报单接口
 * @author Wendy
 * @param doorId  doorId
 * @param doorIdStr  doorIdStr
 */
/**
 *
 */
- (void)requestSubmitWorkOrderWithDoorId:(NSString *)doorId
                               doorIdStr:(NSString*)doorIdStr
                                finished:(SEGRequestCallBack)finished;

// 获取常用门
-(NSArray<SEGNewMyDoorListModel*> *)getCommonDoor;

// 更新常用门
- (void)updateCommonDoors:(NSArray<SEGNewMyDoorListModel *> *)newCommonDoors;

// 获取所有门
-(void)getAllDoorList;

/**
 保存排序之后的门
 
 @param sortDoorList 排序之后的门禁列表
 */
- (void)saveSortDoor:(NSArray<SEGNewMyDoorListModel*> *)sortDoorList;

@end
